cargo/new: add a test for the `--travis` flag
authorСухарик <suhr@i2pmail.org>
Thu, 4 Sep 2014 09:21:56 +0000 (13:21 +0400)
committerСухарик <suhr@i2pmail.org>
Thu, 4 Sep 2014 09:21:56 +0000 (13:21 +0400)
tests/test_cargo_new.rs

index a60f7a71268a8b0145c53d16d9e64796857d2038..5585fefeb1a28d2f72899adc928649a765e312b7 100644 (file)
@@ -65,6 +65,20 @@ test!(simple_git {
                 execs().with_status(0));
 })
 
+test!(simple_travis {
+    os::setenv("USER", "foo");
+    assert_that(cargo_process("new").arg("foo").arg("--travis"),
+                execs().with_status(0));
+
+    assert_that(&paths::root().join("foo"), existing_dir());
+    assert_that(&paths::root().join("foo/Cargo.toml"), existing_file());
+    assert_that(&paths::root().join("foo/src/lib.rs"), existing_file());
+    assert_that(&paths::root().join("foo/.travis.yml"), existing_file());
+
+    assert_that(cargo_process("build").cwd(paths::root().join("foo")),
+                execs().with_status(0));
+})
+
 test!(no_argument {
     assert_that(cargo_process("new"),
                 execs().with_status(1)